
package character_18;

/**
 *
 * @author Administrator
 */
public class Extends {
    public void test(){
    
        System.out.println("test");
    }
}
class Fruit{
    
    int price;
    int weight;

    public Fruit() {
    }

    public Fruit(int price, int weight) {
        this.price = price;
        this.weight = weight;
    }
    
}

class Apple extends Fruit{

    Apple() {
    }

    Apple(int price, int weight){
    
        super(price, weight);
    }
    
    @Override
    public String toString(){
    
        return "Apple";
    }
}

class Banana extends Fruit{

    Banana() {
    }

    Banana(int price, int weight){
    
        super(price, weight);
    }
    
    @Override
    public String toString(){
    
        return "Banana";
    }
}